<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        window.onload = function () {

            var ele_input = document.getElementsByTagName("input");
            ele_input[3].onclick = function () {
                var a = ele_input[0].value;
                var b = ele_input[1].value;
                ele_input[2].value = parseInt(a) + parseInt(b);

            }
            ele_input[4].onclick = function () {
                var a = ele_input[0].value;
                var b = ele_input[1].value;
                ele_input[2].value = a - b;
            }
            ele_input[5].onclick = function () {
                var a = ele_input[0].value;
                var b = ele_input[1].value;
                ele_input[2].value = a * b;
            }
            ele_input[6].onclick = function () {
                var a = ele_input[0].value;
                var b = ele_input[1].value;
                ele_input[2].value = a / b;
            }
            ele_input[7].ondblclick = function () {
                ele_input[0].value = "";
                ele_input[1].value = "";
                ele_input[2].value = "";
            }
        }
    </script>
</head>

<body>
    <h1></h1>
    <form action="">
        数值：<input type="text" placeholder="请输入第一个数"><br>
        数值：<input type="text" placeholder="请输入第一个数"><br>
        结果：<input type="text" name="" id=""><br>
        <input type="button" value="加">
        <input type="button" value="减">
        <input type="button" value="乘">
        <input type="button" value="除">
        <input type="button" value="重置">
    </form>
</body>

<html>